home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / OBJ1_2.ZIP;1 / C_INFO.TXT < prev    next >
Encoding:
Text File  |  1992-12-22  |  6.4 KB  |  154 lines

  1. '
  2. 'Class description:
  3. '
  4. !short:Info class structure:
  5. Class Info:
  6. ~~~~~~~~~~~
  7. This class can produce an object for viewing of the text variable
  8. (memo field).
  9.  
  10.  
  11. Common use:
  12. ~~~~~~~~~~~
  13. LOCAL OBJECT Info OF Info
  14. Info:Buff:=cBigText         //the vieved text is stored to buffer
  15. Info:Init(...)              //or Info:GoodInit(...)
  16.  
  17. The initialistion only adds this object to task stack as a task (look at the
  18. class Task). The activation of virtual process for this object or its
  19. finishing is job for the task swapper.
  20.  
  21. Source code is in C_Info.prg
  22.  
  23. !seealso: c_task.ngo:Task c_box.ngo:Box c_finfo.ngo:FInfo c_color.ngo:Color ob_class.ngo:"Class hierarchy"
  24.  
  25. !short:~~~~~~~~~~~~~~~~~~~~~
  26. !short:create class Info from Task
  27. !short:  export:
  28. !short:  var Wrap      //true
  29. ^BInfo:Wrap^N: public: logical
  30.   Sets the "wrap" property for clipper function Memo Edit, which is used as
  31.   the own dispalyer for the objects of this class.
  32.  
  33. !short:  var FName     //""
  34. ^BInfo:FName^N: private: character
  35.   The file name to which is the viewed text (contet of instvar variable Buff)
  36.   written is stored here, when the user decides to print the viewed text.
  37.   Printing is done by dos command PRINT in the background. For correct
  38.   printing should the resident part of PRINT command be loaded before
  39.   the starting of the program.
  40.  
  41. !short:  var CanPrint  //true
  42. ^BInfo:CanPrint^N: public: logical
  43.   If true, the printing of the viewed text is enabled.
  44.  
  45. !short:  var CanEdit   //false
  46. ^BInfo:CanEdit^N: public: logical
  47.   If true the viewed text can be edited.
  48.  
  49. !short:  var RecNo     //0
  50. ^BInfo:RecNo^N: public: numeric
  51.   Abstract variable for the function HelpField(), used for storing of the
  52.   current record number of database cHelp.
  53.   (Interactive help database, System3.dbf)
  54.  
  55. !short:  var CanErase  //false
  56. ^BInfo:CanErase^N: public: logical
  57.   If true and the viewed text was sent to print (i.e. if Info:Printed is
  58.   true), the system by finishing of this task asks for validation if the file
  59.   can be erased and if yes it is erased. If the file was sent to print it was
  60.   written to temporary file and this file was printed by Print command.
  61.   This instvar variable refers if the file should be erased or no.
  62.  
  63. !short:  var Printed   //false
  64. ^BInfo:Printed^N: private: logical
  65.   If the file was sent to print it is true. Library is informed about
  66.   the creation of the temporary file for its further erasing after
  67.   the end of the task.
  68.  
  69. !short:  var SeeTop    //true
  70. ^BInfo:SeeTop^N: private: logical
  71.   This is only the help instvar variable for unnecessary defining of the
  72.   whole method Process() in the class FInfo. With the instvar private
  73.   variable SeeBottom it is used for finishing of MemoEdit function when
  74.   is there a need of reading of next part of the text from the file
  75.   to instvar variable Buff.
  76.  
  77. !short:  var SeeBottom //true
  78. ^BInfo:SeeBottom^N: private: logical
  79.   This is a help instvar variable used for unnecessary defining of the
  80.   whole method Process() in the class FInfo. See the instvar variable SeeTop.
  81.  
  82. !short:  var TextRow   //1
  83. ^BInfo:TextRow^N: public: numeric
  84.   Sets the text row (Instvar variable Buff), which will be by method
  85.   Process() displayed as first line of the window. Its change can set
  86.   the text view begining.
  87.  
  88. !short:  var TextMax   //0
  89. ^BInfo:TextMax^N: private: numeric
  90.   It is the number of rows for the display mode of MemoEdit function
  91.   (window wrap).
  92.  
  93. !short:  var Buff      //""
  94. ^BInfo:Buff^N: public: character
  95.   This instvar variable is the viewed text stored to.
  96.  
  97. !short:  method New=InfoNew             //o:New() --> self
  98. ^BInfo:New()^N: public: return self
  99.   The object is filled by default values, the following predcessor
  100.   variables are modified:
  101.  
  102.   ^UInfo:Color^N: public: character
  103.     Color definition of the window of this task.
  104.  
  105.   ^UInfo:DoneBlock^N: public: character
  106.     This instvar variable is stored a code block to, which by finishing of
  107.     the task does the erasing of the temporary work file. The workfile is
  108.     created when the user sends the text to print. If you dislike this code
  109.     block, you can replace it by own one just after the creation of the
  110.     object of this class, for example:
  111.                      LOCAL OBJECT Inf OF Info
  112.                      Inf:Buff:=....
  113.                      Inf:DoneBlock:={|Self|NewDoneFunction(Self)}
  114.                      Inf:Init(...)
  115.     Where NewDoneFunction(Self) should be user defined function, which is
  116.     processed by atempt of finishing of this object. As parameter obtains
  117.     self object ^UInf^N. It should return true if the object could be finished
  118.     and false if it couldn't and must stay active. (to stay active means that
  119.     the object is on the top of the stack of the task, its window is repainted
  120.     with active window colors and the method VProcess() is activated for this
  121.     object. All this job is done by task swapper (method Task:Process()).)
  122.  
  123. !short:  method Init=InfoInit           //o:Init(Name,R,C,Rs,Cs,Clr,Shd) --> true
  124. ^BInfo:Init(Name,R,C,Rs,Cs,Clr,Shadow)^N: public: return true
  125.   The object is initialised, all parameters are not compulsory, if used they
  126.   are passed to predcessor method Box:Init(...). For detailed decription use
  127.   look at the class ^UBox^ method ^UInit(...)^N.
  128.  
  129. !short:  method GoodInit=InfoGoodInit   //o:GoodInit(Name,R,C,Rs,Cs,CurSize,Clr,Shd) --> true
  130. ^BInfo:GoodInit(Name,R,C,Rs,Cs,CurSize,Clr,Shadow)^N: public: return true
  131.   The object is initialised, all parameters are not compulsory, if used they
  132.   are passed to predcessor method Box:GoodInit(...). For detailed decription
  133.   use look at the class ^UBox^ method ^UGoodInit(...)^N.
  134.  
  135. !short:  method Print=InfoPrint         //o:Print() --> true/false
  136. ^BInfo:Print()^N: public: return true/false
  137.   Tries to send the text to file for printing, if fails returns false,
  138.   otherwise the file is sent to print, printed by PRINT command and returns
  139.   true.
  140.  
  141. !short:  method VPaint=InfoVPaint       //o:VPaint() --> true
  142. ^BInfo:VPaint()^N: private: return true
  143.   This method is used for painting of the content of the window to the screen.
  144.   If you want to paint the object, use the method Info:Paint(), herited from
  145.   class ^UWindow^N.
  146.  
  147. !short:  method VProcess=InfoVProcess   //o:VProcess() --> true
  148. ^BInfo:VProcess()^N: private: return true
  149.   The text view by using of the function MemoEdit or by activating of the
  150.   method Print() and printing is processed herewith.
  151.  
  152. !short:  endclass
  153.  
  154.